A network device has complex hardware and software, and there is a large quantity of demands for version replacement or upgrade. Because a service interruption time caused by version replacement or upgrade is also counted in a Mean Time To Recovery (MTTR) of the device, how to reduce the service interruption time during version upgrade is a problem that needs to be resolved by each equipment vendor. In-Service Software Upgrade (ISSU) and zero packet loss are goals constantly pursued by operators and equipment vendors.
During a Layer 2 packet forwarding process, packet forwarding is implemented on the basis of matching with a Media Access Control (MAC) address entry. When no matching MAC address entry is found, a packet is sent in a broadcast manner, and MAC address learning is performed. In an existing ISSU processing process, a MAC address is basically processed in the following manner:
During a period of switching from an earlier version to a new version in the ISSU, a MAC address entry of the earlier version is cleared, and packet forwarding in a broadcast manner is triggered. During a process of forwarding in a broadcast manner, in the new version, MAC address re-learning is performed, and a MAC address entry is generated; then packet forwarding is performed by using the generated MAC address entry.
In the foregoing ISSU version upgrade method, the inventor finds that during a period of switching from an earlier version to a new version, a MAC address table needs to be regenerated, which may cause that packets whose matching MAC address entries cannot be found are forwarded in a broadcast manner within this period. Therefore, a large quantity of broadcast packets are generated, and forwarding of the large quantity of broadcast packets may occupy excessive network bandwidth and cause network congestion.